﻿using Newtonsoft.Json;
using Pay.Core;
using Pay.TO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pay.DTO {
    /// <summary>
    /// 公告表 mc_notice
    /// </summary>
    [Serializable]
    [JsonObject(MemberSerialization.OptOut)]
    public class notice_dto {
        /// <summary>
        /// 公告Id
        /// </summary>
        public long id { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        public string title { get; set; }

        /// <summary>
        /// 公告类型（1：官方公告，2：合伙人营销系统，3：系统消息）
        /// </summary>
        public ENoticeType type { get; set; }

        /// <summary>
        /// 链接地址
        /// </summary>
        public string url { get; set; }

        /// <summary>
        /// 公告类型枚举描述
        /// </summary>
        public string type_title { get { return this.type.ToDescription(); } }

        /// <summary>
        /// 公告内容
        /// </summary>
        public string content { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime create_time { get; set; }

        /// <summary>
        /// 状态（0：未发布；1：已发布；2：已删除）
        /// </summary>
        public ENoticeStatus status { get; set; }

        /// <summary>
        /// 状态枚举值描述
        /// </summary>
        public string status_title {
            get { return this.status.ToDescription(); }
        }

        /// <summary>
        /// 点击次数
        /// </summary>
        public int click_num { get; set; }

        /// <summary>
        /// 发布时间
        /// </summary>
        public DateTime? release_time { get; set; }

        /// <summary>
        /// 是否已读
        /// </summary>
        public bool? isRead { get; set; }
    }


    [Serializable]
    [JsonObject(MemberSerialization.OptOut)]
    public class notice_dto_ex : notice_dto {
        /// <summary>
        /// 状态枚举下拉数据
        /// </summary>
        public List<DropdownItem> e_status_list {
            get { return typeof(ENoticeStatus).GetDropdownItemList(); }
        }
        /// <summary>
        /// 状态枚举值
        /// </summary>
        public string status_value { get; set; }

        /// <summary>
        /// 类型枚举下拉数据
        /// </summary>
        public List<DropdownItem> e_type_list {
            get { return typeof(ENoticeType).GetDropdownItemList(); }
        }
        /// <summary>
        /// 类型枚举值
        /// </summary>
        public string type_value { get; set; }

    }
    /// <summary>
    /// 通知消息
    /// </summary>
    public class notice_message_dto {
        /// <summary>
        /// 官方公告未读数量
        /// </summary>
        public int notice_num { get; set; }
        /// <summary>
        /// 商城消息未读数量
        /// </summary>
        public int message_num { get; set; }
        /// <summary>
        /// 系统消息未读数量
        /// </summary>
        public int sys_msg_num { get; set; }
        /// <summary>
        /// 官方公告副标题
        /// </summary>
        public string notice_title { get; set; }
        /// <summary>
        /// 商城消息副标题
        /// </summary>
        public string message_title { get; set; }
        /// <summary>
        /// 系统消息副标题
        /// </summary>
        public string sys_msg_title { get; set; }
    }

    /// <summary>
    /// 消息列表
    /// </summary>
    public class message_list_ex {
        /// <summary>
        /// 标题
        /// </summary>
        public string title { get; set; }
        /// <summary>
        /// 消息标题
        /// </summary>
        public string message_title { get; set; }
    }
    /// <summary>
    /// 消息的对象
    /// </summary>
    public class message_item_ex : message_list_ex {
        /// <summary>
        /// 未读数量
        /// </summary>
        public int number { get; set; }
        /// <summary>
        /// 图片路径
        /// </summary>
        public string icon { get; set; }
        /// <summary>
        /// 类型：0公告，1商城消息，2通知消息，3客服消息
        /// </summary>
        public int type { get; set; }
    }
    /// <summary>
    /// 消息分页对象
    /// </summary>
    public class message_item_page : message_list_ex {
        /// <summary>
        /// 是否已读
        /// </summary>
        public bool is_read { get; set; }
        /// <summary>
        /// 发布时间
        /// </summary>
        public DateTime craete_time { get; set; }
    }

    #region 合伙人营销系统
    public class markting_notice_dto {
        public long id { get; set; }
        /// <summary>
        /// 标题
        /// </summary>
        public string title { get; set; }
        /// <summary>
        /// 发布时间
        /// </summary>
        public DateTime? release_time { get; set; }

        /// <summary>
        /// 是否已读
        /// </summary>
        public bool? isRead { get; set; }
    }

    public class markting_notice_dto_ex : markting_notice_dto {
        /// <summary>
        /// 公告内容
        /// </summary>
        public string content { get; set; }
        ///// <summary>
        ///// 上一条Id
        ///// </summary>
        //public long pre_id { get; set; }
        ///// <summary>
        ///// 下一条Id
        ///// </summary>
        //public long next_id { get; set; }
    }
    #endregion
}
